package com.example.service.impl;

import com.example.entity.Product;
import com.example.mapper.ProductMapper;
import com.example.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper mapper;
    @Override
    public Product getById(Integer proId) {
        return mapper.selectById(proId);
    }

    @Override
    public List<Product> getAll() {
        return mapper.selectList(null);
    }

    @Override
    public Float getProPriceById(Integer proId) {
        return mapper.selectById(proId).getProPrice();
    }
}
